﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Collections.ObjectModel;
using System.Xml.Linq;
using System.Windows;
using System.Reflection;
using System.IO;
using System.ComponentModel;
using Microsoft.Win32;
using System.Data;
using System.Collections;
using System.Windows.Media;
using InteControlSys.SampleService;
using DiagramShop.Ctrl;

namespace InteControlSys.ViewModel
{
    public class TrainControlViewModel:INPCBase
    {
        private TreeTrainViewModel treeTrainVM;

        public TreeTrainViewModel TreeTrainVM
        {
            get { return treeTrainVM; }
            set
            {
                treeTrainVM = value;
                NotifyChanged("TreeTrainVM");

            }
        }

        //private TreeTrainHisViewModel treeTrainHisVM;

        //public TreeTrainHisViewModel TreeTrainHisVM
        //{
        //    get { return treeTrainHisVM; }
        //    set
        //    {
        //        treeTrainHisVM = value;
        //        NotifyChanged("TreeTrainHisVM");

        //    }
        //}

        private NodeViewModel currentSelectedObject;//当前选中对象
        public NodeViewModel CurrentSelectedObject
        {
            get { return currentSelectedObject; }
            set
            {
                currentSelectedObject = value;
                NotifyChanged("CurrentSelectedObject");
            }
        }

        public TrainControlViewModel()
        {
            Init();
        }


        public void Init()
        {
            TreeTrainViewModel vm = new TreeTrainViewModel(this);
            //TreeTrainHisViewModel vmh = new TreeTrainHisViewModel(this);

            NodeViewModel newItem = new TrainArriveViewModel("接车管理");
            vm.RootChildren.Add(newItem);
            newItem = new TrainArriveHisViewModel("接车记录");
            vm.RootChildren.Add(newItem);

            newItem = new TrainBatchViewModel("火车组批");
            vm.RootChildren.Add(newItem); newItem = new TrainBatchHisViewModel("火车组批记录");
            vm.RootChildren.Add(newItem);

            this.TreeTrainVM = vm;
            //this.TreeTrainHisVM = vmh;
        }
    }
}
